Versao tfs ? ou usa otx?
- Fórum
- OTServ
- Pedidos
- Resolvidos
- [Resolvido] [AJUDA] Autoloot
info
Grupo: Artesão
Registrado: 05/06/15
Posts: 119
Reputação: +31
Gênero: Outro

info
Grupo: Campones
Registrado: 06/07/17
Posts: 25
Reputação: 0
Gênero: Masculino

@Dragon Ball Hiper OTX amigo
info
Grupo: Artesão
Registrado: 05/06/15
Posts: 119
Reputação: +31
Gênero: Outro

2 minutos atrás, viimalagogin disse:@Dragon Ball Hiper OTX amigo
certo .
teste ...
-
<?xml version="1.0" encoding="ISO-8859-1"?>
-
<mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="none.com" enabled="yes">
-
<config name="Loot_func"><![CDATA[
-
info = {
-
OnlyPremium = true,
-
AutomaticDeposit = true,
-
BlockMonsters = {},
-
BlockItemsList = {2123,2515}
-
}
-
-
function setPlayerStorageTable(cid, storage, tab)
-
local tabstr = "&"
-
for i,x in pairs(tab) do
-
tabstr = tabstr .. i .. "," .. x .. ";"
-
end
-
setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1))
-
end
-
function getPlayerStorageTable(cid, storage)
-
local tabstr = getPlayerStorageValue(cid, storage)
-
local tab = {}
-
if type(tabstr) ~= "string" then
-
return {}
-
end
-
if tabstr:sub(1,1) ~= "&" then
-
return {}
-
end
-
local tabstr = tabstr:sub(2, #tabstr)
-
local a = string.explode(tabstr, ";")
-
for i,x in pairs(a) do
-
local b = string.explode(x, ",")
-
tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2]
-
end
-
return tab
-
end
-
function ExistItemByName(name) -- by vodka
-
local items = io.open("data/items/items.xml", "r"):read("*all")
-
local get = items:match('name="' .. name ..'"')
-
if get == nil or get == "" then
-
return false
-
end
-
return true
-
end
-
function isInTable(cid, item)
-
for _,i in pairs(getPlayerStorageTable(cid, 27000))do
-
if tonumber(i) == tonumber(item) then
-
return true
-
end
-
end
-
return false
-
end
-
function addItemTable(cid, item)
-
local x = {}
-
for i = 1,#getPlayerStorageTable(cid, 27000) do
-
table.insert(x,getPlayerStorageTable(cid, 27000))
info
Grupo: Campones
Registrado: 06/07/17
Posts: 25
Reputação: 0
Gênero: Masculino

@Dragon Ball Hiper Ele funfou meio bugado. Eu consigo adicionar o item pra recolher, porem depois eu nao consigo abrir mais a janela pra ver a lista de items e nem remover. Usei os seguintes comandos: !autoloot ---- !autoloot add, worms ----- !autoloot remove, worms
info
Grupo: Artesão
Registrado: 05/06/15
Posts: 119
Reputação: +31
Gênero: Outro

34 minutos atrás, viimalagogin disse:@Dragon Ball Hiper Ele funfou meio bugado. Eu consigo adicionar o item pra recolher, porem depois eu nao consigo abrir mais a janela pra ver a lista de items e nem remover. Usei os seguintes comandos: !autoloot ---- !autoloot add, worms ----- !autoloot remove, worms
olá fiz os teste e esta normal , nao esta usando nenhum talkactions que esta afetando nao ?
info
Grupo: Campones
Registrado: 06/07/17
Posts: 25
Reputação: 0
Gênero: Masculino

Esta dando este erro na distro pra ser mais específico:
Description:data/lib/100-shortcut.lua:260: attempt to index a boolean value
Nao tem nenhuma outra talkaction relacionada ao autoloot no servidor, apenas essa do script adicionada :s
info
Grupo: Artesão
Registrado: 05/06/15
Posts: 119
Reputação: +31
Gênero: Outro

Agora, viimalagogin disse:Esta dando este erro na distro pra ser mais específico:
Description:data/lib/100-shortcut.lua:260: attempt to index a boolean valueNao tem nenhuma outra talkaction relacionada ao autoloot no servidor, apenas essa do script adicionada :s
teste a original 100-shortcut.lua
function doPlayerSendToChannel(cid, target, type, text, channel, time)
return doCreatureChannelSay(cid, target, text, type, channel)
end
function getItemWeaponType(uid)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
end
return getItemInfo(thing.itemid).weaponType
end
function getItemRWInfo(uid)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
end
local item, flags = getItemInfo(thing.itemid), 0
if(item.readable) then
flags = 1
end
if(item.writable) then
flags = flags + 2
end
return flags
end
function getItemLevelDoor(itemid)
local item = getItemInfo(itemid)
return item and item.levelDoor or false
end
function isContainer(uid)
local thing = getThing(uid)
return thing.uid > 0 and thing.items ~= nil
end
function isItemStackable(itemid)
local item = getItemInfo(itemid)
return item and item.stackable or false
end
function isItemRune(itemid)
local item = getItemInfo(itemid)
return item and item.type == ITEM_TYPE_RUNE or false
end
function isItemDoor(itemid)
local item = getItemInfo(itemid)
return item and item.type == ITEM_TYPE_DOOR or false
end
function isItemContainer(itemid)
local item = getItemInfo(itemid)
return item and item.group == ITEM_GROUP_CONTAINER or false
end
function isItemFluidContainer(itemid)
local item = getItemInfo(itemid)
return item and item.group == ITEM_GROUP_FLUID or false
end
function isItemMovable(itemid)
local item = getItemInfo(itemid)
return item and item.movable or false
end
function isCorpse(uid)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
end
local item = getItemInfo(thing.itemid)
return item and item.corpseType ~= 0 or false
end
function getContainerCapById(itemid)
local item = getItemInfo(itemid)
if(not item or item.group ~= 2) then
return false
end
return item.maxItems
end
function getMonsterAttackSpells(name)
local monster = getMonsterInfo(name)
return monster and monster.attacks or false
end
function getMonsterHealingSpells(name)
local monster = getMonsterInfo(name)
return monster and monster.defenses or false
end
function getMonsterLootList(name)
local monster = getMonsterInfo(name)
return monster and monster.loot or false
end
function getMonsterSummonList(name)
local monster = getMonsterInfo(name)
return monster and monster.summons or false
end
function doItemSetActionId(uid, aid)
return doItemSetAttribute(uid, "aid", aid)
end
function getFluidSourceType(itemid)
local item = getItemInfo(itemid)
return item and item.fluidSource or false
end
function getDepotId(uid)
return getItemAttribute(uid, "depotid") or false
end
function getItemDescriptions(uid)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
end
local item = getItemInfo(thing.itemid)
return {
name = getItemAttribute(uid, "name") or item.name,
plural = getItemAttribute(uid, "pluralname") or item.plural,
article = getItemAttribute(uid, "article") or item.article,
special = getItemAttribute(uid, "description") or "",
text = getItemAttribute(uid, "text") or "",
writer = getItemAttribute(uid, "writer") or "",
date = getItemAttribute(uid, "date") or 0
}
end
function doRemoveThing(uid)
if(isCreature(uid)) then
return doRemoveCreature(uid)
end
return doRemoveItem(uid)
end
function setAttackFormula(combat, type, minl, maxl, minm, maxm, min, max)
local min, max = min or 0, max or 0
return setCombatFormula(combat, type, -1, 0, -1, 0, minl, maxl, minm, maxm, -min, -max)
end
function setHealingFormula(combat, type, minl, maxl, minm, maxm, min, max)
local min, max = min or 0, max or 0
return setCombatFormula(combat, type, 1, 0, 1, 0, minl, maxl, minm, maxm, min, max)
end
function doChangeTypeItem(uid, subtype)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
end
local subtype = subtype or 1
return doTransformItem(thing.uid, thing.itemid, subtype)
end
function doPlayerResetIdleTime(cid)
return doPlayerSetIdleTime(cid, 0)
end
function doPlayerSetExperienceRate(cid, value)
return doPlayerSetRate(cid, SKILL__LEVEL, value)
end
function doPlayerSetMagicRate(cid, value)
return doPlayerSetRate(cid, SKILL__MAGLEVEL, value)
end
function isSummon(cid)
return getCreatureMaster(cid) and getCreatureMaster(cid) ~= cid
end
function getPartyLeader(cid)
local party = getPartyMembers(cid)
if(type(party) ~= 'table') then
return 0
end
return party[1]
end
function isInParty(cid)
return type(getPartyMembers(cid)) == 'table'
end
function doShutdown()
return doSetGameState(GAMESTATE_SHUTDOWN)
end
function getPlayerGroupName(cid)
return getGroupInfo(getPlayerGroupId(cid)).name
end
function getPlayerVocationName(cid)
return getVocationInfo(getPlayerVocation(cid)).name
end
function getPromotedVocation(vid)
return getVocationInfo(vid).promotedVocation
end
function doPlayerRemovePremiumDays(cid, days)
return doPlayerAddPremiumDays(cid, -days)
end
function getPlayerMasterPos(cid)
return getTownTemplePosition(getPlayerTown(cid))
end
function getHouseOwner(houseId)
return getHouseInfo(houseId).owner
end
function getHouseName(houseId)
return getHouseInfo(houseId).name
end
function getHouseEntry(houseId)
return getHouseInfo(houseId).entry
end
function getHouseRent(houseId)
return getHouseInfo(houseId).rent
end
function getHousePrice(houseId)
return getHouseInfo(houseId).price
end
function getHouseTown(houseId)
return getHouseInfo(houseId).town
end
function getHouseDoorsCount(houseId)
return table.maxn(getHouseInfo(houseId).doors)
end
function getHouseBedsCount(houseId)
return table.maxn(getHouseInfo(houseId).beds)
end
function getHouseTilesCount(houseId)
return table.maxn(getHouseInfo(houseId).tiles)
end
function getItemNameById(itemid)
return getItemDescriptionsById(itemid).name
end
function getItemPluralNameById(itemid)
return getItemDescriptionsById(itemid).plural
end
function getItemArticleById(itemid)
return getItemDescriptionsById(itemid).article
end
function getItemName(uid)
return getItemDescriptions(uid).name
end
function getItemPluralName(uid)
return getItemDescriptions(uid).plural
end
function getItemArticle(uid)
return getItemDescriptions(uid).article
end
function getItemText(uid)
return getItemDescriptions(uid).text
end
function getItemSpecialDescription(uid)
return getItemDescriptions(uid).special
end
function doSetItemSpecialDescription(uid, str)
return doItemSetAttribute(uid, "description", str)
end
function getItemWriter(uid)
return getItemDescriptions(uid).writer
end
function getItemDate(uid)
return getItemDescriptions(uid).date
end
function getTilePzInfo(pos)
return getTileInfo(pos).protection
end
function getTileZoneInfo(pos)
local tmp = getTileInfo(pos)
if(tmp.pvp) then
return 2
end
if(tmp.nopvp) then
return 1
end
return 0
end
function playerExists(name, multiworld)
return getPlayerGUIDByName(name, multiworld or false) ~= nil
end
function doPlayerWithdrawAllMoney(cid)
return doPlayerWithdrawMoney(cid, getPlayerBalance(cid))
end
function doPlayerDepositAllMoney(cid)
return doPlayerDepositMoney(cid, getPlayerMoney(cid))
end
function doPlayerTransferAllMoneyTo(cid, target)
return doPlayerTransferMoneyTo(cid, target, getPlayerBalance(cid))
end
function isNumeric(str)
return tonumber(str) ~= nil
end
function doPlayerBuyItem(cid, itemid, count, cost, charges)
return doPlayerRemoveMoney(cid, cost) and doPlayerGiveItem(cid, itemid, count, charges)
end
function doPlayerBuyItemContainer(cid, containerid, itemid, count, cost, charges)
return doPlayerRemoveMoney(cid, cost) and doPlayerGiveItemContainer(cid, containerid, itemid, count, charges)
end
function isPlayerUsingOtclient(cid)
return getPlayerOperatingSystem(cid) >= CLIENTOS_OTCLIENT_LINUX
end
function getPlayerPassword(cid)
local AccInfo = db.getResult("SELECT `password` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
local AccPass = AccInfo:getDataString("password")
return AccPass
end
function doPlayerAddPremiumPoints(cid, points)
return db.Query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
function doRemoveHouse(cid)
local pid = getPlayerGUID(cid)
cleanHouse(getHouseByPlayerGUID(pid))
setHouseOwner(getHouseByPlayerGUID(pid), NO_OWNER_PHRASE,true)
return true
end
function warnPlayer(cid, msg)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return doPlayerSendCancel(cid, msg)
end
function createCombat(typea, effect, distEffect, area, mins, maxs)
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, typea)
setCombatParam(combat, COMBAT_PARAM_EFFECT, effect)
if(distEffect)then
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, distEffect)
end
if(type(mins) == "string" and type(maxs) == "string")then
function getSpellDamage(cid, skill, att, attackStrength)
local lvl, mlvl, minss, maxss = getPlayerLevel(cid), getPlayerMagLevel(cid), "", ""
minss = "return " .. mins
minss = minss:gsub("lvl", lvl)
minss = minss:gsub("mlv", mlvl)
maxss = "return " .. maxs
maxss = maxss:gsub("lvl", lvl)
maxss = maxss:gsub("mlv", mlvl)
local min = -math.ceil(loadstring(minss)())
local max = -math.ceil(loadstring(maxss)())
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")
end
if(type(area) == "table")then
local areaa = createCombatArea(area)
setCombatArea(combat, areaa)
end
return combat
end
info
Grupo: Campones
Registrado: 06/07/17
Posts: 25
Reputação: 0
Gênero: Masculino

Ainda não deu amigo, substitui e ainda da o mesmo erro. Tem mais alguma opinião ai do que pode ser?
Isso é o que acontece quando tento adicionar outro item na lista:
[Error - TalkAction Interface]local cid = 268446042local words = "!autoloot"local param = "add, dragon scale mail"local channel = 65534domodlib('Loot_func')local t = string.explode(string.lower(param), ",")if info.OnlyPremium == true and not isPremium(cid) thendoPlayerSendCancel(cid, "you must be a premium account.") return trueelseif not t[1] thenShowItemsTabble(cid) return trueelseif tonumber(t[1]) or tonumber(t[2]) thendoPlayerSendCancel(cid, "enter!autoloot add,name or !autoloot remove,name") return trueelseif isInArray({"add","remove"}, tostring(t[1])) thenlocal func,check = tostring(t[1]) == "add" and addItemTable or removeItemTable, tostring(t[1]) == "add" and true or falselocal item = ExistItemByName(tostring(t[2]))if not item thendoPlayerSendCancel(cid, "This item does not exist.") return trueendlocal itemlist = getItemIdByName(tostring(t[2]))if check == true and isInArray(info.BlockItemsList, itemlist) thendoPlayerSendCancel(cid, "You can not add this item in the list!") return trueelseif isInTable(cid, itemlist) == check thendoPlayerSendCancel(cid, "This Item "..(check == true and "already" or "is not").." in your list.") return trueendfunc(cid, itemlist)doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,check == true and "you added the item "..t[2].." in the list" or "you removed the item "..t[2].." from the list") return trueendreturn trueDescription:[string "info = {..."]:11: attempt to concatenate local 'x' (a table value)
Vou explicar melhor o problema:
Quando eu pego um char que nunca executou o comando, ele funciona normal, ele abre a lista sem ter adicionado nenhum item. Porem, apos eu adicionar qualquer item, ele passa a recolher o mesmo, mas buga, não consigo mais abrir a lista de items e nem remove-lo. Ai fica dando estes erros na distro.
info
Grupo: Artesão
Registrado: 05/06/15
Posts: 119
Reputação: +31
Gênero: Outro

Vou verificar ja retorno .
Editado Setembro 5 por Dragon Ball Hiper
info
Grupo: Campones
Registrado: 06/07/17
Posts: 25
Reputação: 0
Gênero: Masculino

@Dragon Ball Hiper conseguiu saber oq pode ser que buga?
info
Grupo: Artesão
Registrado: 05/06/15
Posts: 119
Reputação: +31
Gênero: Outro

Em 05/09/2017 at 17:20, viimalagogin disse:@Dragon Ball Hiper conseguiu saber oq pode ser que buga?
desculpa a demora mais nao estou consigo , vou termina o meu e publico xD
info
Grupo: Campones
Registrado: 06/07/17
Posts: 25
Reputação: 0
Gênero: Masculino

@Dragon Ball Hiper Nao precisa mais nao, ja foi resolvido. Mto obrigado
info
Grupo: Artesão
Registrado: 05/06/15
Posts: 119
Reputação: +31
Gênero: Outro

12 horas atrás, viimalagogin disse:@Dragon Ball Hiper Nao precisa mais nao, ja foi resolvido. Mto obrigado
se voce postar como resolveu ou script ajudará todos.
info
Grupo: Campones
Registrado: 06/07/17
Posts: 25
Reputação: 0
Gênero: Masculino

É o mesmo que vc me passou de início, eu que tinha mexido nele, por isso tinha bugado. Esta idêntico agora e funciona.
Muito obrigado mesmo.


info
Grupo: Campones
Registrado: 06/07/17
Posts: 25
Reputação: 0
Gênero: Masculino
Olá pessoal, eu tenho esse script de autoloot no meu servidor e ele funciona POR PARTES.
• Funciona apenas recolhimento dos Golds, Mais Slots para players premium ou não.
• Não funciona o recolhimento dos items, qualquer que seja o item, ele manda mensagem falando que não existe. "THIS ITEM DOES NOT EXIST"
Gostaria que ele recolhesse todos os items normalmente!
Eu uso esse script MODS abaixo:
QUALQUER TIPO DE AJUDA, OU SOLUÇÃO EU DOU +REP!!! OBRIGADO!!!
Editado Agosto 22 por viimalagogin